geo.cc: let it build w/o expat.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 12 Jul 2013 21:57:34 +0000 (21:57 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 12 Jul 2013 21:57:34 +0000 (21:57 +0000)
cet_util.cc: fixups for the XML_UNICODE case, needed for Windows.

gpsbabel/cet_util.cc
gpsbabel/geo.cc

index 99ebc296c0323928869c7fd0a6fcb27de7a21f1c..51ab342bc7b1d7ebfb8637820be6b94f77803802 100644 (file)
@@ -1278,7 +1278,7 @@ const char* xml_convert_to_char_string_n(const XML_Char* src, int* n)
   *n = i;
 
   /* Appropriately size (not zero terminated) buffer */
-  utf8 = utf8b = xmalloc(i);
+  utf8 = utf8b = (char *)xmalloc(i);
 
   for (j = 0; utf8 < utf8b + i; j++) {
     utf8 += cet_ucs4_to_utf8(utf8, 6, src[j]);
@@ -1310,7 +1310,7 @@ const char* xml_convert_to_char_string(const XML_Char* src)
   }
 
   /* We return a NUL terminated string. */
-  utf8 = utf8b = xmalloc(i + 1);
+  utf8 = utf8b = (char *)xmalloc(i + 1);
   in = src;
 
   for (j = 0; utf8 < utf8b + i; j++) {
@@ -1351,7 +1351,7 @@ const char** xml_convert_attrs_to_char_string(const XML_Char** xml_attr)
   }
 
   // Allocate space
-  char_attrs = xmalloc((size + 1) * sizeof(char*));
+  char_attrs = (const char **)xmalloc((size + 1) * sizeof(char*));
 
   // Duplicate strings
   for (i = 0; i < size; ++i) {
index 9b60496b77fee3142f14323ab8a44252ca9bcc20..99f701f18eb76e507ef005b69256259478412f90 100644 (file)
@@ -341,7 +341,6 @@ void wpt_terr(const char* args, const char** unused)
   }
   waypt_alloc_gc_data(wpt_tmp)->terr = atof(args) * 10;
 }
-#endif
 
 static void
 geo_rd_init(const char* fname)
@@ -355,6 +354,7 @@ geo_read(void)
   xml_read();
 }
 #endif
+#endif
 
 static void
 geo_rd_deinit(void)